package com.yx.front.controller;


import com.yx.front.config.global.CommonResult;
import com.yx.front.manager.MessageRecordManager;
import com.yx.front.model.MessageRecord;
import com.yx.front.model.param.MessageRecordParam;
import com.yx.front.model.vo.MessageRecordVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 留言记录表 前端控制器
 * </p>
 *
 * @author YangXiong
 * @since 2023-04-06
 */
@Slf4j
@RestController
@Api(tags = "消息记录接口")
@RequestMapping("/message-record")
public class MessageRecordController {
    @Resource
    private MessageRecordManager messageRecordManager;

    @PostMapping("/message/list")
    @ApiOperation("消息列表")
    public CommonResult<List<MessageRecordVo>> getMessageList(@RequestBody MessageRecordParam param){
        return messageRecordManager.getMessageList(param);
    }

    @PostMapping("/send")
    @ApiOperation("发消息")
    public CommonResult<String> send(@RequestBody MessageRecordParam param){
        return messageRecordManager.send(param);
    }

}

